home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 17 / CU Amiga Magazine's Super CD-ROM 17 (1997)(EMAP Images)(GB)[!][issue 1997-12].iso / CUCD / Utilities / AmiSearchII / ArchiveScripts / AS2H
Encoding:
AmigaDOS Script File  |  1997-09-29  |  2.2 KB  |  96 lines

  1. .key FileName
  2.  
  3. ; Archive handling script used by Amiga guide output of AmiSearch II
  4. ; Version 1.0 (September 14, 0h12)
  5. ; This script is a part of the AmiSearch II package. It is FORBIDDEN
  6. ; to redistribute it alone. If you modify it please send it to me
  7. ; and I will consider including it in the AmiSearch II package.
  8. ; (c) 1997 Franck ANIERE (aniere@univ-mlv.fr)
  9.  
  10. ; Global initialization : you should customize this part
  11.  
  12. SET DECOMPDIR   "Ram:"
  13. SET DECOMPDRIVE "Rad:"
  14. SET LHA "C:Lha"
  15. SET LZX "C:Lzx"
  16. SET DMS "C:dms"
  17. SET GFX "Aq1:Gfx/Viewers/Visage MODE 167940"
  18. SET OUT "CON:0/16/640/100/Unpacking archive/CLOSE/WAIT"
  19.  
  20. ; Before trying to identify we check its existence
  21.  
  22. IF NOT EXISTS "<FileName>"
  23.    ECHO "I can't open this file" >$OUT
  24.    QUIT
  25. ENDIF
  26.  
  27. ; Now we should remove path
  28.  
  29. set TheFileName `BASENAME "<FileName>"`
  30.  
  31. ; First step : test if we have a LHA archive (.lha/.lzh)
  32.  
  33. SET TheBasename `BASENAME "$TheFileName" .lha`
  34. IF NOT "$TheBasename" EQ "$TheFileName"
  35.   $LHA x "<FileName>" $DECOMPDIR >$OUT
  36.   QUIT
  37. ENDIF
  38.  
  39. SET TheBasename `BASENAME "$TheFileName" .lzh`
  40. IF NOT "$TheBasename" EQ "$TheFileName"
  41.   $LHA x "<FileName>" $DECOMPDIR >$OUT
  42.   QUIT
  43. ENDIF
  44.  
  45. ; Second step : test if we have a LZX archive
  46.  
  47. SET TheBasename `BASENAME "$TheFileName" .lzx`
  48. IF NOT "$TheBasename" EQ "$TheFileName"
  49.   $LZX x "<FileName>" $DECOMPDIR >$OUT
  50.   QUIT
  51. ENDIF
  52.  
  53. ; Third step : test if we have a DMS archive
  54.  
  55. SET TheBasename `BASENAME "$TheFileName" .dms`
  56. IF NOT "$TheBasename" EQ "$TheFileName"
  57.   $DMS WRITE "<FileName>" TO $DECOMPDIR >$OUT
  58.   QUIT
  59. ENDIF
  60.  
  61. ; Now it may be a picture, so let's check...
  62.  
  63. ; First step : GIF picture ?
  64.  
  65. SET TheBasename `BASENAME "$TheFileName" .gif`
  66. IF NOT "$TheBasename" EQ "$TheFileName"
  67.    $GFX "<FileName>"
  68.    QUIT
  69. ENDIF
  70.  
  71. ; Second step : and why not a JPEG picture ?
  72.  
  73. SET TheBasename `BASENAME "$TheFileName" .jpg`
  74. IF NOT "$TheBasename" EQ "$TheFileName"
  75.    $GFX "<FileName>"
  76.    QUIT
  77. ENDIF
  78.  
  79. SET TheBasename `BASENAME "$TheFileName" .jpeg`
  80. IF NOT "$TheBasename" EQ "$TheFileName"
  81.    $GFX "<FileName>"
  82.    QUIT
  83. ENDIF
  84.  
  85. ; Third step : so it may be a PNG picture...
  86.  
  87. SET TheBasename `BASENAME "$TheFileName" .png`
  88. IF NOT "$TheBasename" EQ "$TheFileName"
  89.    $GFX "<FileName>"
  90.    QUIT
  91. ENDIF
  92.  
  93. ; Mmmm.....this is an unknown file...
  94.  
  95. ECHO "I can't identify this file format, sorry..." >$OUT
  96.